Optimal. Leaf size=95 \[ -a b e x-\frac {b^2 e (c+d x) \text {ArcTan}(c+d x)}{d}+\frac {e (a+b \text {ArcTan}(c+d x))^2}{2 d}+\frac {e (c+d x)^2 (a+b \text {ArcTan}(c+d x))^2}{2 d}+\frac {b^2 e \log \left (1+(c+d x)^2\right )}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5151, 12, 4946,
5036, 4930, 266, 5004} \begin {gather*} \frac {e (c+d x)^2 (a+b \text {ArcTan}(c+d x))^2}{2 d}+\frac {e (a+b \text {ArcTan}(c+d x))^2}{2 d}-a b e x-\frac {b^2 e (c+d x) \text {ArcTan}(c+d x)}{d}+\frac {b^2 e \log \left ((c+d x)^2+1\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 266
Rule 4930
Rule 4946
Rule 5004
Rule 5036
Rule 5151
Rubi steps
\begin {align*} \int (c e+d e x) \left (a+b \tan ^{-1}(c+d x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int e x \left (a+b \tan ^{-1}(x)\right )^2 \, dx,x,c+d x\right )}{d}\\ &=\frac {e \text {Subst}\left (\int x \left (a+b \tan ^{-1}(x)\right )^2 \, dx,x,c+d x\right )}{d}\\ &=\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}-\frac {(b e) \text {Subst}\left (\int \frac {x^2 \left (a+b \tan ^{-1}(x)\right )}{1+x^2} \, dx,x,c+d x\right )}{d}\\ &=\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}-\frac {(b e) \text {Subst}\left (\int \left (a+b \tan ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}+\frac {(b e) \text {Subst}\left (\int \frac {a+b \tan ^{-1}(x)}{1+x^2} \, dx,x,c+d x\right )}{d}\\ &=-a b e x+\frac {e \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}-\frac {\left (b^2 e\right ) \text {Subst}\left (\int \tan ^{-1}(x) \, dx,x,c+d x\right )}{d}\\ &=-a b e x-\frac {b^2 e (c+d x) \tan ^{-1}(c+d x)}{d}+\frac {e \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {\left (b^2 e\right ) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,c+d x\right )}{d}\\ &=-a b e x-\frac {b^2 e (c+d x) \tan ^{-1}(c+d x)}{d}+\frac {e \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {b^2 e \log \left (1+(c+d x)^2\right )}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 107, normalized size = 1.13 \begin {gather*} \frac {e \left (a (c+d x) (-2 b+a c+a d x)+2 b \left (-b (c+d x)+a \left (1+c^2+2 c d x+d^2 x^2\right )\right ) \text {ArcTan}(c+d x)+b^2 \left (1+c^2+2 c d x+d^2 x^2\right ) \text {ArcTan}(c+d x)^2+b^2 \log \left (1+(c+d x)^2\right )\right )}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 124, normalized size = 1.31
method | result | size |
derivativedivides | \(\frac {\frac {e \left (d x +c \right )^{2} a^{2}}{2}+\frac {e \,b^{2} \left (d x +c \right )^{2} \arctan \left (d x +c \right )^{2}}{2}+\frac {e \,b^{2} \arctan \left (d x +c \right )^{2}}{2}-e \,b^{2} \arctan \left (d x +c \right ) \left (d x +c \right )+\frac {e \,b^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+e a b \left (d x +c \right )^{2} \arctan \left (d x +c \right )+e a b \arctan \left (d x +c \right )-e \left (d x +c \right ) a b}{d}\) | \(124\) |
default | \(\frac {\frac {e \left (d x +c \right )^{2} a^{2}}{2}+\frac {e \,b^{2} \left (d x +c \right )^{2} \arctan \left (d x +c \right )^{2}}{2}+\frac {e \,b^{2} \arctan \left (d x +c \right )^{2}}{2}-e \,b^{2} \arctan \left (d x +c \right ) \left (d x +c \right )+\frac {e \,b^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+e a b \left (d x +c \right )^{2} \arctan \left (d x +c \right )+e a b \arctan \left (d x +c \right )-e \left (d x +c \right ) a b}{d}\) | \(124\) |
risch | \(-\frac {e \,b^{2} \left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) \ln \left (1+i \left (d x +c \right )\right )^{2}}{8 d}+\frac {b e \left (-2 i a \,d^{2} x^{2}+b \,d^{2} x^{2} \ln \left (1-i \left (d x +c \right )\right )-4 i a c x d +2 b c d x \ln \left (1-i \left (d x +c \right )\right )+2 i b d x +\ln \left (1-i \left (d x +c \right )\right ) b \,c^{2}+b \ln \left (1-i \left (d x +c \right )\right )\right ) \ln \left (1+i \left (d x +c \right )\right )}{4 d}-\frac {e d \,b^{2} x^{2} \ln \left (1-i \left (d x +c \right )\right )^{2}}{8}+\frac {i e d a b \,x^{2} \ln \left (1-i \left (d x +c \right )\right )}{2}-\frac {e \,b^{2} c x \ln \left (1-i \left (d x +c \right )\right )^{2}}{4}+i e a b c x \ln \left (1-i \left (d x +c \right )\right )-\frac {e \,b^{2} c^{2} \ln \left (1-i \left (d x +c \right )\right )^{2}}{8 d}-\frac {i e \,b^{2} x \ln \left (1-i \left (d x +c \right )\right )}{2}+\frac {e \,a^{2} d \,x^{2}}{2}+\frac {e a b \,c^{2} \arctan \left (d x +c \right )}{d}+e \,a^{2} c x -\frac {e \,b^{2} \ln \left (1-i \left (d x +c \right )\right )^{2}}{8 d}-\frac {e \,b^{2} c \arctan \left (d x +c \right )}{d}-a b e x +\frac {e a b \arctan \left (d x +c \right )}{d}+\frac {e \,b^{2} \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d}\) | \(393\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 229 vs.
\(2 (94) = 188\).
time = 1.15, size = 229, normalized size = 2.41 \begin {gather*} \frac {1}{2} \, a^{2} d x^{2} e + {\left (x^{2} \arctan \left (d x + c\right ) - d {\left (\frac {x}{d^{2}} + \frac {{\left (c^{2} - 1\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{3}} - \frac {c \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{3}}\right )}\right )} a b d e + a^{2} c x e + \frac {{\left (2 \, {\left (d x + c\right )} \arctan \left (d x + c\right ) - \log \left ({\left (d x + c\right )}^{2} + 1\right )\right )} a b c e}{d} + \frac {b^{2} e \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right ) + {\left (b^{2} d^{2} x^{2} e + 2 \, b^{2} c d x e + b^{2} c^{2} e + b^{2} e\right )} \arctan \left (d x + c\right )^{2} - 2 \, {\left (b^{2} d x e + b^{2} c e\right )} \arctan \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.95, size = 147, normalized size = 1.55 \begin {gather*} \frac {{\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + b^{2}\right )} \arctan \left (d x + c\right )^{2} e + b^{2} e \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right ) + 2 \, {\left (a b d^{2} x^{2} + a b c^{2} - b^{2} c + {\left (2 \, a b c - b^{2}\right )} d x + a b\right )} \arctan \left (d x + c\right ) e + {\left (a^{2} d^{2} x^{2} + 2 \, {\left (a^{2} c - a b\right )} d x\right )} e}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.38, size = 240, normalized size = 2.53 \begin {gather*} \begin {cases} a^{2} c e x + \frac {a^{2} d e x^{2}}{2} + \frac {a b c^{2} e \operatorname {atan}{\left (c + d x \right )}}{d} + 2 a b c e x \operatorname {atan}{\left (c + d x \right )} + a b d e x^{2} \operatorname {atan}{\left (c + d x \right )} - a b e x + \frac {a b e \operatorname {atan}{\left (c + d x \right )}}{d} + \frac {b^{2} c^{2} e \operatorname {atan}^{2}{\left (c + d x \right )}}{2 d} + b^{2} c e x \operatorname {atan}^{2}{\left (c + d x \right )} - \frac {b^{2} c e \operatorname {atan}{\left (c + d x \right )}}{d} + \frac {b^{2} d e x^{2} \operatorname {atan}^{2}{\left (c + d x \right )}}{2} - b^{2} e x \operatorname {atan}{\left (c + d x \right )} + \frac {b^{2} e \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d} + \frac {b^{2} e \operatorname {atan}^{2}{\left (c + d x \right )}}{2 d} - \frac {i b^{2} e \operatorname {atan}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\c e x \left (a + b \operatorname {atan}{\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.61, size = 216, normalized size = 2.27 \begin {gather*} {\mathrm {atan}\left (c+d\,x\right )}^2\,\left (\frac {e\,b^2\,c^2+e\,b^2}{2\,d}+b^2\,c\,e\,x+\frac {b^2\,d\,e\,x^2}{2}\right )-x\,\left (a\,e\,\left (b-3\,a\,c\right )+2\,a^2\,c\,e\right )-d^2\,\mathrm {atan}\left (c+d\,x\right )\,\left (\frac {x\,\left (b^2\,e-2\,a\,b\,c\,e\right )}{d^2}-\frac {a\,b\,e\,x^2}{d}\right )+\frac {b^2\,e\,\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )}{2\,d}+\frac {a^2\,d\,e\,x^2}{2}+\frac {b\,e\,\mathrm {atan}\left (\frac {b\,c\,e\,\left (a\,c^2-b\,c+a\right )+b\,d\,e\,x\,\left (a\,c^2-b\,c+a\right )}{-e\,b^2\,c+a\,e\,b\,c^2+a\,e\,b}\right )\,\left (a\,c^2-b\,c+a\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________